package com.yhsimon.iterator;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

/**
 * @author： YHSimon
 * @date： 2021-10-12 14:35
 */
public class InfoCollege implements College {
    List<Department> departmentList;

    public InfoCollege() {
        departmentList = new ArrayList<>();
        addDepartment("信息管理", "X");
        addDepartment("网络安全", "W");
    }

    @Override
    public String getName() {
        return "信息学院";
    }

    @Override
    public void addDepartment(String name, String desc) {
        Department department = new Department(name, desc);
        departmentList.add(department);
    }

    @Override
    public Iterator createIterator() {
        return new InfoCollegeIterator(departmentList);
    }
}
